package com.lemon.stock.dao

import androidx.room.*
import com.lemon.stock.entity.Bonus

@Dao
interface BonusDao {

    @Query("SELECT * FROM bonus WHERE id IN (:ids)")
    fun getBonusByIds(ids:List<Long>): List<Bonus>

    @Query("SELECT * FROM bonus WHERE stock_id= :bonusId ")
    fun getBonus(bonusId: String): Bonus

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(vararg bonus: Bonus)

    @Update
    fun update(vararg bonus: Bonus)

    @Query("DELETE FROM bonus")
    fun clear()
}